<?php
require_once($application_folder."/controllers/navigator.php");
class Core extends navigator 
{

    function __construct()
    {
        parent::__construct();
        $this->load->model('translator');  
        $this->load->library('dataload');  
        $this->load->library('assetsload');
        $this->lang->load('asp', $this->lang_ses->getlang()); 
    }

    function index($page='home',$sub='') 
    {   
        
        if(substr($page,0,3)=='lng'){$this->lang_ses->setLang(substr($page,3,2));$p = substr($page,5,strlen($page)-2);$s = $sub;if($s!=''){redirect( base_url().$p.'/'.$s );}else{redirect( base_url().$p );}}
        
        $this->data['page'] = $page;
        $this->data['sub'] = $sub;
        $this->data['lang'] = $this->lang_ses->getlang();   


        $this->dataload->getdata($page, $this);
        $this->assetsload->getassets($page, $this);

        if($sub==''){ $this->navigate('site/'.$page); }else{ $this->navigate('site/'.$page.'/'.$sub); }            

    }

}